Skip to content

feat: Add "What's New" changelog bottom sheet#82

Open
Moustachauve wants to merge 2 commits intodevfrom
whats-new-view
Open

feat: Add "What's New" changelog bottom sheet#82
Moustachauve wants to merge 2 commits intodevfrom
whats-new-view

Conversation

@Moustachauve
Copy link
Copy Markdown
Owner

Summary

Adds a changelog system that automatically shows users what's new after an app update, mirroring the feature added to WLED Android in PR #155.

How it works

  • On every app launch, ChangelogViewModel compares the current app version against the last-seen version stored in UserDefaults.
  • First install: version is saved silently — no sheet is shown.
  • After an update: relevant changelogs are assembled and presented as a bottom sheet.
  • Settings > About > Show Changelog: lets users revisit the full changelog history at any time.

New Files

File Purpose
wled/Changelog/7.0.0.md Changelog for v7.0.0
wled/Changelog/7.1.0.md Changelog for v7.1.0
wled/Changelog/dev.md Staging file shown in beta builds
wled/Changelog/CHANGELOG_GUIDE.md Contributor guidelines for the changelog workflow
wled/Service/ChangelogProvider.swift Reads/filters/assembles versioned .md files from the bundle
wled/ViewModel/ChangelogViewModel.swift Manages display state and UserDefaults persistence
wled/View/ChangelogBottomSheet.swift Native SwiftUI bottom sheet UI

Changes

  • DeviceListView: owns the ChangelogViewModel and auto-presents the sheet on version change
  • Settings: new "Show Changelog" button (with ✨ sparkles icon) in the About section
  • Localizable.xcstrings: new strings for en and fr-CA (What's New, Awesome, Show Changelog, Version %@, Close)

Changelog Developer Workflow

When contributing, append your changes to dev.md. Before a release, rename dev.md to the target version (e.g. 7.2.0.md). See CHANGELOG_GUIDE.md for full details.

Notes

  • No new dependencies — reuses the existing MarkdownUI SPM package already in the project
  • iOS 16 compatible (.symbolEffect pulse on the sparkles icon is gated behind @available(iOS 17.0, *))

Adds a changelog system that automatically shows users what changed
after an app update via a native iOS bottom sheet.

- Add ChangelogProvider: reads versioned .md files from the Changelog/
  bundle directory, filters by version range, and assembles a combined
  markdown string with section headers and dividers
- Add ChangelogViewModel: tracks last-seen version in UserDefaults,
  suppresses display on first install, and exposes showAllChangelogs()
  for the Settings menu
- Add ChangelogBottomSheet: native SwiftUI sheet with orange→pink→purple
  gradient title, sparkles icon, MarkdownUI rendering, and an 'Awesome'
  dismiss button
- Add Changelog/ directory with 7.0.0.md, 7.1.0.md, dev.md (beta only),
  and CHANGELOG_GUIDE.md documenting the dev workflow
- Integrate into DeviceListView: auto-shows after version upgrade
- Add 'Show Changelog' button to Settings > About section
- Add localizations for en and fr-CA (What's New, Awesome, Show
  Changelog, Version %@, Close)
Reduce vertical padding on the 'Awesome' button from 14 to 10 and add 16pt top padding to the bottom sheet container to improve visual spacing. Preserves existing horizontal and bottom paddings, button style, and background material.
@github-actions github-actions Bot added documentation Improvements or additions to documentation feature labels Apr 10, 2026
@Moustachauve Moustachauve added the minor For new features. label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive changelog system, including a ChangelogProvider for managing versioned markdown files and a ChangelogBottomSheet for displaying updates. It also adds localization support and a ChangelogViewModel to track the user's last seen version. Feedback was provided regarding a logging error and the proper localization of interpolated strings.

/// - Returns: A combined markdown string, or `nil` if no changelogs apply.
func getChangelog(lastSeenVersion lastSeenVersionStr: String, currentVersion currentVersionStr: String) -> String? {
guard let currentVersion = SemanticVersion(currentVersionStr) else {
Self.logger.error("Invalid current version string: \(lastSeenVersionStr)")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The log message incorrectly references lastSeenVersionStr when the validation failure occurs for currentVersionStr. It should be updated to reflect the correct variable name.

Suggested change
Self.logger.error("Invalid current version string: \(lastSeenVersionStr)")
Self.logger.error("Invalid current version string: \(currentVersionStr)")

for changelogFile in validChangelogs {
guard let content = readChangelogFile(changelogFile.filename) else { continue }

let versionHeader = "# " + String(localized: "Version \(changelogFile.displayVersion)")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the general rules for this repository, interpolated strings should be localized using String(format: NSLocalizedString(...), ...) to ensure they are correctly processed by the localization system, especially when matching keys in Localizable.xcstrings that contain placeholders like %@.

Suggested change
let versionHeader = "# " + String(localized: "Version \(changelogFile.displayVersion)")
let versionHeader = "# " + String(format: NSLocalizedString("Version %@", comment: ""), changelogFile.displayVersion)
References
  1. In SwiftUI, interpolated strings are not automatically localized even if a matching format string exists in Localizable.xcstrings. Explicitly use String(format: NSLocalizedString("KEY", comment: ""), ...) for localization of strings with variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature minor For new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant